namespace QMVnSoft.Lists
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;

    public class FormDmBpLister : FormListLister
    {
        private IContainer components;

        public FormDmBpLister()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x2bd, 0x10a);
            base.LocalFieldCount = 0;
            base.LocalFieldName = "MA_BP";
            base.LocalTableName = "DMBP";
            base.Name = "FormDmBpLister";
            base.OrderFieldNames = "STT_BP";
            base.RefreshAfterChanged = true;
            this.Text = "Danh mục bộ phận";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public override bool OnAdd()
        {
            base.LocalFormEditor = new FormDmBpEditor();
            return base.OnAdd();
        }

        public override bool OnEdit()
        {
            base.LocalFormEditor = new FormDmBpEditor();
            return base.OnEdit();
        }

        public override void OnFillData()
        {
            object[][] objArray = new object[5][];
            object[] objArray2 = new object[4];
            objArray2[0] = "Ma_Bp";
            objArray2[1] = "Mã bộ phận";
            objArray2[2] = "C";
            objArray[0] = objArray2;
            object[] objArray3 = new object[4];
            objArray3[0] = "Ten_Bp";
            objArray3[1] = "Tên bộ phận";
            objArray3[2] = "C";
            objArray[1] = objArray3;
            object[] objArray4 = new object[4];
            objArray4[0] = "Ma_Bp_Me";
            objArray4[1] = "Bộ phận mẹ";
            objArray4[2] = "C";
            objArray[2] = objArray4;
            objArray[3] = new object[] { "Bac_Bp", "Cấp", "N", AppInstance.TextNumericFormat.None };
            object[] objArray6 = new object[4];
            objArray6[0] = "Bp_Cuoi";
            objArray6[1] = "Bộ phận cuối";
            objArray6[2] = "C";
            objArray[4] = objArray6;
            base.ColNames = objArray;
            base.OnFillData();
        }

        public override void OnRefresh()
        {
            base.LocalDataSet = new DmBpDataAccess().GetDataSet();
            base.OnRefresh();
        }
    }
}

